bitkeeper revision 1.1159.2.1 (41139d17RLVEh5iKEyxO0hVWOtdS6Q)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Fri, 6 Aug 2004 15:00:39 +0000 (15:00 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Fri, 6 Aug 2004 15:00:39 +0000 (15:00 +0000)
Domain ids are 16 bits.

13 files changed:
tools/libxc/xc.h
tools/libxc/xc_domain.c
tools/libxc/xc_evtchn.c
tools/libxc/xc_linux_build.c
tools/libxc/xc_linux_save.c
tools/libxc/xc_netbsd_build.c
tools/libxc/xc_private.c
xen/include/hypervisor-ifs/dom0_ops.h
xen/include/hypervisor-ifs/event_channel.h
xen/include/hypervisor-ifs/hypervisor-if.h
xen/include/hypervisor-ifs/io/domain_controller.h
xen/include/hypervisor-ifs/sched_ctl.h
xen/include/xen/sched.h

index 8b7ee33273354e00967341a1a1c8d1448b4b05dd..b2cf0c67ba4826a38d11843f777b1f164c16000e 100644 (file)
@@ -149,7 +149,7 @@ int xc_rrobin_global_set(int xc_handle, u64 slice);
 
 int xc_rrobin_global_get(int xc_handle, u64 *slice);
 
-#define DOMID_SELF              (0x7FFFFFFEU)
+#define DOMID_SELF              (0x7FFEU)
 
 typedef struct {
 #define EVTCHNSTAT_closed       0  /* Chennel is not in use.                 */
index d389757ceeda3e578711bc2c32399ae7b81de115..10017c74fe7cb6a415e0dcab62d6050510b1a1cf 100644 (file)
@@ -25,7 +25,7 @@ int xc_domain_create(int xc_handle,
     op.u.createdomain.cpu = cpu;
 
     if ( (err = do_dom0_op(xc_handle, &op)) == 0 )
-        *pdomid = (u32)op.u.createdomain.domain;
+        *pdomid = (u16)op.u.createdomain.domain;
 
     return err;
 }    
@@ -88,7 +88,7 @@ int xc_domain_getinfo(int xc_handle,
         op.u.getdomaininfo.ctxt = NULL; /* no exec context info, thanks. */
         if ( do_dom0_op(xc_handle, &op) < 0 )
             break;
-        info->domid   = (u32)op.u.getdomaininfo.domain;
+        info->domid   = (u16)op.u.getdomaininfo.domain;
 
         info->cpu     =
             (op.u.getdomaininfo.flags>>DOMFLAGS_CPUSHIFT) & DOMFLAGS_CPUMASK;
@@ -111,7 +111,7 @@ int xc_domain_getinfo(int xc_handle,
         strncpy(info->name, op.u.getdomaininfo.name, XC_DOMINFO_MAXNAME);
         info->name[XC_DOMINFO_MAXNAME-1] = '\0';
 
-        next_domid = (u32)op.u.getdomaininfo.domain + 1;
+        next_domid = (u16)op.u.getdomaininfo.domain + 1;
         info++;
     }
 
@@ -129,7 +129,7 @@ int xc_domain_getfullinfo(int xc_handle,
     op->u.getdomaininfo.ctxt = ctxt;
 
     rc = do_dom0_op(xc_handle, op);
-    if ( ((u32)op->u.getdomaininfo.domain != domid) && rc > 0 )
+    if ( ((u16)op->u.getdomaininfo.domain != domid) && rc > 0 )
         return -ESRCH;
     else
         return rc;
index 624f5b1c156000d9063b75d227c974385ccd7d5b..52f737746750a94589c67d5476b86a831442a204 100644 (file)
@@ -115,7 +115,7 @@ int xc_evtchn_status(int xc_handle,
         switch ( status->status = op.u.status.status )
         {
         case EVTCHNSTAT_interdomain:
-            status->u.interdomain.dom  = (u32)op.u.status.u.interdomain.dom;
+            status->u.interdomain.dom  = (u16)op.u.status.u.interdomain.dom;
             status->u.interdomain.port = op.u.status.u.interdomain.port;
             break;
         case EVTCHNSTAT_pirq:
index 23ec09cb095faefcd00a25ab043f9ba6d2f25f32..39dd6c3d08f38df39d2aa84fb7f98f71a2bd960c 100644 (file)
@@ -440,7 +440,7 @@ int xc_linux_build(int xc_handle,
     op.u.getdomaininfo.domain = (domid_t)domid;
     op.u.getdomaininfo.ctxt = ctxt;
     if ( (do_dom0_op(xc_handle, &op) < 0) || 
-         ((u32)op.u.getdomaininfo.domain != domid) )
+         ((u16)op.u.getdomaininfo.domain != domid) )
     {
         PERROR("Could not get info on domain");
         goto error_out;
index c74e209bdc84ae023f7f03e8768ae4f0c780e138..5fb8f674c4abe4c55bc7731313e2136fc9e91dc9 100644 (file)
@@ -364,7 +364,7 @@ int xc_linux_save(int xc_handle, XcIOContext *ioctxt)
             pgd[HYPERVISOR_VIRT_START>>L2_PAGETABLE_SHIFT]>>PAGE_SHIFT;
 
         live_mfn_to_pfn_table = 
-            mfn_mapper_map_single(xc_handle, ~0UL
+            mfn_mapper_map_single(xc_handle, 0x7FFFU
                                   PAGE_SIZE*1024, PROT_READ, 
                                   mfn_to_pfn_table_start_mfn );
     }
index 833a533ab6c47363e575d474e278d55c66c42e6a..41adfa935a2a4a47a7e9582607b44b046f285f2c 100644 (file)
@@ -254,7 +254,7 @@ int xc_netbsd_build(int xc_handle,
     op.u.getdomaininfo.domain = (domid_t)domid;
     op.u.getdomaininfo.ctxt = ctxt;
     if ( (do_dom0_op(xc_handle, &op) < 0) || 
-         ((u32)op.u.getdomaininfo.domain != domid) )
+         ((u16)op.u.getdomaininfo.domain != domid) )
     {
         PERROR("Could not get info on domain");
         goto error_out;
index 8807f8a9bf05f0feb1d5b1f394894dcf2562b3f4..a7c46873ee14ab3a5e7534e2e92e0416448d4da6 100644 (file)
@@ -296,7 +296,7 @@ long long  xc_domain_get_cpu_usage( int xc_handle, domid_t domid )
     op.u.getdomaininfo.domain = (domid_t)domid;
     op.u.getdomaininfo.ctxt = NULL;
     if ( (do_dom0_op(xc_handle, &op) < 0) || 
-         ((u32)op.u.getdomaininfo.domain != domid) )
+         ((u16)op.u.getdomaininfo.domain != domid) )
     {
         PERROR("Could not get info on domain");
         return -1;
index 502c14744d775fec5f9e0d47ac7637782a4fdcc7..8cea03fac2897d6cbfcfc1c1a9661cb3737d92a9 100644 (file)
@@ -19,7 +19,7 @@
  * This makes sure that old versions of dom0 tools will stop working in a
  * well-defined way (rather than crashing the machine, for instance).
  */
-#define DOM0_INTERFACE_VERSION   0xAAAA0010
+#define DOM0_INTERFACE_VERSION   0xAAAA0011
 
 #define MAX_DOMAIN_NAME    16
 
@@ -29,7 +29,8 @@
 typedef struct {
     /* IN variables. */
     domid_t       domain;             /*  0 */
-    u32           __pad;
+    u16           __pad0;
+    u32           __pad1;
     memory_t      max_pfns;           /*  8 */
     MEMORY_PADDING;
     void         *buffer;             /* 16 */
@@ -54,10 +55,11 @@ typedef struct {
     MEMORY_PADDING;
     u8           name[MAX_DOMAIN_NAME]; /*  8 */
     u32          cpu;                 /* 24 */
-    u32          __pad              /* 28 */
+    u32          __pad0;              /* 28 */
     /* IN/OUT parameters. */
     /* If 0, domain is allocated. If non-zero use it unless in use. */
     domid_t      domain;              /* 32 */
+    u16          __pad1;
     /* OUT parameters. */
 } PACKED dom0_createdomain_t; /* 36 bytes */
 
@@ -65,24 +67,28 @@ typedef struct {
 typedef struct {
     /* IN variables. */
     domid_t      domain;              /*  0 */
+    u16          __pad;
 } PACKED dom0_destroydomain_t; /* 4 bytes */
 
 #define DOM0_PAUSEDOMAIN      10
 typedef struct {
     /* IN parameters. */
     domid_t domain;                   /*  0 */
+    u16     __pad;
 } PACKED dom0_pausedomain_t; /* 4 bytes */
 
 #define DOM0_UNPAUSEDOMAIN    11
 typedef struct {
     /* IN parameters. */
     domid_t domain;                   /*  0 */
+    u16     __pad;
 } PACKED dom0_unpausedomain_t; /* 4 bytes */
 
 #define DOM0_GETDOMAININFO    12
 typedef struct {
     /* IN variables. */
     domid_t  domain;                  /*  0 */ /* NB. IN/OUT variable. */
+    u16     __pad;
     /* OUT variables. */
 #define DOMFLAGS_DYING     (1<<0) /* Domain is scheduled to die.             */
 #define DOMFLAGS_CRASHED   (1<<1) /* Crashed domain; frozen for postmortem.  */
@@ -111,7 +117,8 @@ typedef struct {
 typedef struct {
     /* IN variables. */
     domid_t                 domain;   /*  0 */
-    u32                     __pad;    /*  4 */
+    u16                     __pad0;   /*  2 */
+    u32                     __pad1;   /*  4 */
     /* IN/OUT parameters */
     full_execution_context_t *ctxt;   /*  8 */
     MEMORY_PADDING;
@@ -120,6 +127,7 @@ typedef struct {
 #define DOM0_IOPL             14
 typedef struct {
     domid_t domain;                   /*  0 */
+    u16     __pad;
     u32     iopl;                     /*  4 */
 } PACKED dom0_iopl_t; /* 8 bytes */
 
@@ -140,17 +148,17 @@ typedef struct {
 typedef struct {
     /* IN variables. */
     domid_t domain;                   /*  0 */
-    u8  opcode;                       /*  4 */
-    u8  __pad0, __pad1, __pad2;
-    u32 in1;                          /*  8 */
-    u32 in2;                          /* 12 */
-    u32 in3;                          /* 16 */
-    u32 in4;                          /* 20 */
+    u8  opcode;                       /*  2 */
+    u8  __pad;
+    u32 in1;                          /*  4 */
+    u32 in2;                          /*  8 */
+    u32 in3;                          /* 12 */
+    u32 in4;                          /* 16 */
     /* OUT variables. */
-    u32 status;                       /* 24 */
-    u32 out1;                         /* 28 */
-    u32 out2;                         /* 32 */
-} PACKED dom0_debug_t; /* 36 bytes */
+    u32 status;                       /* 20 */
+    u32 out1;                         /* 24 */
+    u32 out2;                         /* 28 */
+} PACKED dom0_debug_t; /* 32 bytes */
 
 /*
  * Set clock such that it would read <secs,usecs> after 00:00:00 UTC,
@@ -177,6 +185,7 @@ typedef struct {
     memory_t pfn;          /*  0: Machine page frame number to query.       */
     MEMORY_PADDING;
     domid_t domain;        /*  8: To which domain does the frame belong?    */
+    u16     __pad;
     /* OUT variables. */
     /* Is the page PINNED to a type? */
     u32 type;              /* 12: see above type defs */
@@ -200,6 +209,7 @@ typedef struct {
 typedef struct {
     /* IN variables. */
     domid_t      domain;              /*  0 */
+    u16          __pad;
     s32          cpu;                 /*  4: -1 implies unpin */
 } PACKED dom0_pincpudomain_t; /* 8 bytes */
 
@@ -234,6 +244,7 @@ typedef struct {
 typedef struct {
     /* IN variables. */
     domid_t      domain;              /*  0 */
+    u16          __pad;
     u32          bus;                 /*  4 */
     u32          dev;                 /*  8 */
     u32          func;                /* 12 */
@@ -274,6 +285,7 @@ typedef struct dom0_shadow_control
 typedef struct {
     /* IN variables. */
     domid_t        domain;            /*  0 */
+    u16            __pad;
     u32            op;                /*  4 */
     unsigned long *dirty_bitmap;      /*  8: pointer to locked buffer */
     MEMORY_PADDING;
@@ -289,6 +301,7 @@ typedef struct {
 typedef struct {
     /* IN variables. */
     domid_t  domain;                  /*  0 */
+    u16      __pad;
     u8       name[MAX_DOMAIN_NAME];   /*  4 */
 } PACKED dom0_setdomainname_t; /* 20 bytes */
 
@@ -296,7 +309,8 @@ typedef struct {
 typedef struct {
     /* IN variables. */
     domid_t     domain;               /*  0 */
-    u32         __pad;
+    u16         __pad0;
+    u32         __pad1;
     memory_t    initial_memkb;        /*  8 */
     MEMORY_PADDING;
 } PACKED dom0_setdomaininitialmem_t; /* 16 bytes */
@@ -305,7 +319,8 @@ typedef struct {
 typedef struct {
     /* IN variables. */
     domid_t     domain;               /*  0 */
-    u32         __pad;
+    u16         __pad0;
+    u32         __pad1;
     memory_t    max_memkb;            /*  8 */
     MEMORY_PADDING;
 } PACKED dom0_setdomainmaxmem_t; /* 16 bytes */
@@ -314,7 +329,8 @@ typedef struct {
 typedef struct {
     /* IN variables. */
     domid_t  domain;                  /*  0 */
-    u32         __pad;
+    u16      __pad0;
+    u32      __pad1;
     memory_t num;                     /*  8 */
     MEMORY_PADDING;
     /* IN/OUT variables. */
index 5868cab6fd423d62167ab7e77a898d7ea168b5fb..fd6d0325f88ff2da85c40662bd41382c0d8497f8 100644 (file)
 #define EVTCHNOP_bind_interdomain 0
 typedef struct {
     /* IN parameters. */
-    domid_t dom1, dom2;               /*  0,  4 */
+    domid_t dom1, dom2;               /*  0,  2 */
     /* OUT parameters. */
-    u32     port1, port2;             /*  8, 12 */
-} PACKED evtchn_bind_interdomain_t; /* 16 bytes */
+    u32     port1, port2;             /*  4,  8 */
+} PACKED evtchn_bind_interdomain_t; /* 12 bytes */
 
 /*
  * EVTCHNOP_bind_virq: Bind a local event channel to IRQ <irq>.
@@ -65,6 +65,7 @@ typedef struct {
 typedef struct {
     /* IN parameters. */
     domid_t dom;                      /*  0 */
+    u16     __pad;
     u32     port;                     /*  4 */
     /* No OUT parameters. */
 } PACKED evtchn_close_t; /* 8 bytes */
@@ -92,6 +93,7 @@ typedef struct {
 typedef struct {
     /* IN parameters */
     domid_t dom;                      /*  0 */
+    u16     __pad;
     u32     port;                     /*  4 */
     /* OUT parameters */
 #define EVTCHNSTAT_closed       0  /* Chennel is not in use.                 */
@@ -103,6 +105,7 @@ typedef struct {
     union {                           /* 12 */
         struct {
             domid_t dom;                              /* 12 */
+            u16     __pad;
             u32     port;                             /* 16 */
         } PACKED interdomain; /* EVTCHNSTAT_interdomain */
         u32 pirq;      /* EVTCHNSTAT_pirq        */   /* 12 */
index bc8515425afe466752b552f8c36a3522dd9c5e64..bb3e1938d74a2f244fdb714c10ac5086fc6a9d29 100644 (file)
 
 #ifndef __ASSEMBLY__
 
-typedef u32 domid_t;
+typedef u16 domid_t;
 /* DOMID_SELF is used in certain contexts to refer to oneself. */
-#define DOMID_SELF (0x7FFFFFFEU)
+#define DOMID_SELF (0x7FFEU)
 
 /*
  * Send an array of these to HYPERVISOR_mmu_update().
index 76dd164fcb88666ef26ba4d643dfb8db802868ba..da1f2441de7e5463091630a4f4737c708781fb3d 100644 (file)
@@ -223,6 +223,7 @@ typedef struct {
 typedef struct { 
     /* IN */
     domid_t    domid;         /*  0: Domain attached to new interface.   */
+    u16        __pad;
     u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
     /* OUT */
     u32        status;        /*  8 */
@@ -237,6 +238,7 @@ typedef struct {
 typedef struct { 
     /* IN */
     domid_t    domid;         /*  0: Identify interface to be destroyed. */
+    u16        __pad;
     u32        blkif_handle;  /*  4: ...ditto...                         */
     /* OUT */
     u32        status;        /*  8 */
@@ -251,6 +253,7 @@ typedef struct {
 typedef struct { 
     /* IN */
     domid_t    domid;         /*  0: Domain attached to new interface.   */
+    u16        __pad;
     u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
     memory_t   shmem_frame;   /*  8: Page cont. shared comms window.     */
     MEMORY_PADDING;
@@ -268,6 +271,7 @@ typedef struct {
 typedef struct { 
     /* IN */
     domid_t    domid;         /*  0: Domain attached to new interface.   */
+    u16        __pad;
     u32        blkif_handle;  /*  4: Domain-specific interface handle.   */
     /* OUT */
     u32        status;        /*  8 */
@@ -277,6 +281,7 @@ typedef struct {
 typedef struct { 
     /* IN */
     domid_t    domid;         /*  0: Identify blkdev interface.          */
+    u16        __pad;
     u32        blkif_handle;  /*  4: ...ditto...                         */
     blkif_vdev_t vdevice;     /*  8: Interface-specific id for this VBD. */
     u16        readonly;      /* 10: Non-zero -> VBD isn't writeable.    */
@@ -288,9 +293,10 @@ typedef struct {
 typedef struct {
     /* IN */
     domid_t    domid;         /*  0: Identify blkdev interface.          */
+    u16        __pad0;        /*  2 */
     u32        blkif_handle;  /*  4: ...ditto...                         */
     blkif_vdev_t vdevice;     /*  8: Interface-specific id of the VBD.   */
-    u16        __pad        /* 10 */
+    u16        __pad1;        /* 10 */
     /* OUT */
     u32        status;        /* 12 */
 } PACKED blkif_be_vbd_destroy_t; /* 16 bytes */
@@ -299,10 +305,11 @@ typedef struct {
 typedef struct { 
     /* IN */
     domid_t    domid;         /*  0: Identify blkdev interface.          */
+    u16        __pad0;        /*  2 */
     u32        blkif_handle;  /*  4: ...ditto...                         */
     blkif_extent_t extent;    /*  8: Physical extent to append to VBD.   */
     blkif_vdev_t vdevice;     /* 28: Interface-specific id of the VBD.   */
-    u16        __pad        /* 30 */
+    u16        __pad1;        /* 30 */
     /* OUT */
     u32        status;        /* 32 */
 } PACKED blkif_be_vbd_grow_t; /* 36 bytes */
@@ -311,9 +318,10 @@ typedef struct {
 typedef struct { 
     /* IN */
     domid_t    domid;         /*  0: Identify blkdev interface.          */
+    u16        __pad0;        /*  2 */
     u32        blkif_handle;  /*  4: ...ditto...                         */
     blkif_vdev_t vdevice;     /*  8: Interface-specific id of the VBD.   */
-    u16        __pad        /* 10 */
+    u16        __pad1;        /* 10 */
     /* OUT */
     u32        status;        /* 12 */
 } PACKED blkif_be_vbd_shrink_t; /* 16 bytes */
@@ -451,9 +459,10 @@ typedef struct {
 typedef struct { 
     /* IN */
     domid_t    domid;         /*  0: Domain attached to new interface.   */
+    u16        __pad0;        /*  2 */
     u32        netif_handle;  /*  4: Domain-specific interface handle.   */
     u8         mac[6];        /*  8 */
-    u16        __pad        /* 14 */
+    u16        __pad1;        /* 14 */
     /* OUT */
     u32        status;        /* 16 */
 } PACKED netif_be_create_t; /* 20 bytes */
@@ -467,6 +476,7 @@ typedef struct {
 typedef struct { 
     /* IN */
     domid_t    domid;         /*  0: Identify interface to be destroyed. */
+    u16        __pad;
     u32        netif_handle;  /*  4: ...ditto...                         */
     /* OUT */
     u32   status;             /*  8 */
@@ -481,13 +491,14 @@ typedef struct {
 typedef struct { 
     /* IN */
     domid_t    domid;          /*  0: Domain attached to new interface.   */
+    u16        __pad0;         /*  2 */
     u32        netif_handle;   /*  4: Domain-specific interface handle.   */
     memory_t   tx_shmem_frame; /*  8: Page cont. tx shared comms window.  */
     MEMORY_PADDING;
     memory_t   rx_shmem_frame; /* 16: Page cont. rx shared comms window.  */
     MEMORY_PADDING;
     u16        evtchn;         /* 24: Event channel for notifications.    */
-    u16        __pad         /* 26 */
+    u16        __pad1;         /* 26 */
     /* OUT */
     u32        status;         /* 28 */
 } PACKED netif_be_connect_t; /* 32 bytes */
@@ -501,6 +512,7 @@ typedef struct {
 typedef struct { 
     /* IN */
     domid_t    domid;         /*  0: Domain attached to new interface.   */
+    u16        __pad;
     u32        netif_handle;  /*  4: Domain-specific interface handle.   */
     /* OUT */
     u32        status;        /*  8 */
index 0a07cc8c95226f2856ba2f2a99e7be4233d040d1..0131cc4bb3cf725e2c0784eb8548258ff3494ba2 100644 (file)
@@ -52,7 +52,8 @@ struct sched_adjdom_cmd
     u32     sched_id;                 /*  0 */
     u32     direction;                /*  4 */
     domid_t domain;                   /*  8 */
-    u32     __pad;
+    u16     __pad0;
+    u32     __pad1;
     union {                           /* 16 */
         struct bvt_adjdom
         {
index ef68c443a047f6bb6709c2eba9c2ebc97edd4235..06b6faf6cc41fc5b3e560f05f3f50641b5afb550 100644 (file)
@@ -155,7 +155,7 @@ struct domain
 extern struct domain idle0_task;
 
 extern struct domain *idle_task[NR_CPUS];
-#define IDLE_DOMAIN_ID   (0x7FFFFFFFU)
+#define IDLE_DOMAIN_ID   (0x7FFFU)
 #define is_idle_task(_p) (test_bit(DF_IDLETASK, &(_p)->flags))
 
 void free_domain_struct(struct domain *d);